﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace YT.XH.IgE
{
    public partial class frmIgeDetectControl : Form
    {
        public bool mblnIsStandardFormula=false ;
        public string mstrSickRecID = "";
        public double mdblOrigValue = 0;
        public double mdblExamValue = 0;
        public double mDilutionFactor = 100;
        public string mstrRecID = "0";
        /// <summary>
        /// 是否是 生成 标准曲线 的 实验数据
        /// </summary>
        public bool IsStandardFormula
        {
            get
            {
                return mblnIsStandardFormula;
            }
            set
            {
                mblnIsStandardFormula = value;
            }
        }

        /// <summary>
        /// OD 值， 从EXCEL中读取的 检测值
        /// </summary>
        public double OrigValue
        {
            get
            {
                return mdblOrigValue;
            }
            set
            {
                mdblOrigValue = value;
            }
        }

        /// <summary>
        /// 经过标准曲线方程计算后的浓度值
        /// </summary>
        public double ExamValue
        {
            get
            {
                return mdblExamValue;
            }
            set
            {
                mdblExamValue = value;
            }
        }

        public double DilutionFactor
        {
            get
            {
                return DilutionFactor;
            }
            set
            {
                mDilutionFactor = value;
            }
        }

        /// <summary>
        /// 检测对应的患者编号
        /// </summary>
        public string SickRecID
        {
            get
            {
                return mstrSickRecID;
            }
            set
            {
                SickRecID = value ;
            }
        }


        /// <summary>
        /// 保存IgEDetectDetail中的RecID
        /// </summary>
        public string RecID
        {
            get
            {
                return mstrRecID;
            }
            set
            {
                RecID = value ;
            }
        }

        public frmIgeDetectControl()
        {
            InitializeComponent();
            
        }

        private void SetFormColor()
        {
            if (mblnIsStandardFormula)
            {
                this.ForeColor = Color.LightGray;
            }
            else
            {
                this.ForeColor =Color.Moccasin;
            }
        }

        private void SetlblText()
        {
            if (mblnIsStandardFormula)
            {
                this.lblID.Text = "";                
            }
            else
            {

            }
        }

        private void frmIgeDetectControl_Load(object sender, EventArgs e)
        {
            //pnlStandardFormula.Visible = false;
            chkIsStandardFormula.Visible = false;
            txtDetectLabel.ReadOnly = true;
            txtCalValue.ReadOnly = true;
        }

        private void chkIsStandardFormula_CheckedChanged(object sender, EventArgs e)
        {
            if (chkIsStandardFormula.Checked)
            {
                //pnlStandardFormula.Visible = true;
                txtCalValue.ReadOnly = false;
                txtCalValue.Focus();
                
            }
            else
            {
                //pnlStandardFormula.Visible = false;
            }
        }

        private void txtStandardValue_TextChanged(object sender, EventArgs e)
        {

        }

        private void btnSickDetail_Click(object sender, EventArgs e)
        {
            MessageBox.Show("....");  
        }

        private void frmIgeDetectControl_MouseHover(object sender, EventArgs e)
        {
            btnSickDetail.Visible = true;
        }

        private void frmIgeDetectControl_MouseLeave(object sender, EventArgs e)
        {
            btnSickDetail.Visible = false;
        }
    }
}
